
<!DOCTYPE html>
<html lang="en">
    <head><meta name="generator" content="Hexo 3.9.0">
    
        <title>FairyGUI - LayaAir</title>
    
        <meta charset="utf-8">
        <meta name="description" content="FairyGUI教程">
        <meta name="keywords" content="FairyGUI,FGUI,FairyGUI教程">
        
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

        <meta property="og:type" content="article">
        <meta property="og:title" content="-LayaAirFairyGUI">
        <meta property="og:description" content="FairyGUI教程">

        <meta name="twitter:card" content="summary">
        <meta name="twitter:title" content="LayaAir — FairyGUI">
        <meta name="twitter:description" content="FairyGUI教程">

      <!--  <link href='//fonts.proxy.ustclug.org/css?family=Source+Sans+Pro:300,400,600|Roboto Mono' rel='stylesheet' type='text/css'> -->

        <!-- main page styles -->
        <link rel="stylesheet" href="/docs/css/page.css">

        <!-- this needs to be loaded before guide's inline scripts -->
        <script src="/docs/js/vue.min.js"></script>
        <script>window.PAGE_TYPE = "guide_sdk"</script>
    </head>
    <body class="docs">        <div id="mobile-bar" data-bg-text="FairyGUI">
            <a class="menu-button"></a>
        </div>
        <div id="header">
  <ul id="nav">
    <li><a href="/docs/guide/" class="nav-link current">教程</a></li>
<li><a href="/docs/examples/" class="nav-link">在线示例</a></li>
<li><a href="/docs/release_notes/" class="nav-link">发行日志</a></li>
<li><a href="/" class="nav-link">首页</a></li>
  </ul>
</div>

        
            <div id="main" class="fix-sidebar">
                
                    
    <div class="sidebar">
    <ul class="main-menu">
        <li><a href="/docs/guide/" class="nav-link current">教程</a></li>
<li><a href="/docs/examples/" class="nav-link">在线示例</a></li>
<li><a href="/docs/release_notes/" class="nav-link">发行日志</a></li>
<li><a href="/" class="nav-link">首页</a></li>
    </ul>
    <div class="list">
        <ul class="menu-root">
            

	 			
	                
	                <li>
	                    <a href="/docs/guide/index.html" class="sidebar-link">导读</a>
	                </li>
	            
	
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/index.html" class="sidebar-link">编辑器使用基础</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/project_settings.html" class="sidebar-link">项目设置</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/package.html" class="sidebar-link">包</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/branch.html" class="sidebar-link">分支</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/publish.html" class="sidebar-link">发布</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/object.html" class="sidebar-link">元件</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/image.html" class="sidebar-link">图片</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/movieclip.html" class="sidebar-link">动画</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/graph.html" class="sidebar-link">图形</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/loader.html" class="sidebar-link">装载器</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/text.html" class="sidebar-link">文本</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/richtext.html" class="sidebar-link">富文本</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/group.html" class="sidebar-link">组</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/component.html" class="sidebar-link">组件</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/scrollpane.html" class="sidebar-link">滚动容器</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/controller.html" class="sidebar-link">控制器</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/relation.html" class="sidebar-link">关联系统</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/label.html" class="sidebar-link">标签</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/button.html" class="sidebar-link">按钮</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/combobox.html" class="sidebar-link">下拉框</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/progressbar.html" class="sidebar-link">进度条</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/slider.html" class="sidebar-link">滑动条</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/scrollbar.html" class="sidebar-link">滚动条</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/list.html" class="sidebar-link">列表</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/tree.html" class="sidebar-link">树</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/popup.html" class="sidebar-link">Popup</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/dragdrop.html" class="sidebar-link">Drag&Drop</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/window.html" class="sidebar-link">窗口系统</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/transition.html" class="sidebar-link">动效</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/adaptation.html" class="sidebar-link">适配</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/i18n.html" class="sidebar-link">多国语言</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/export.html" class="sidebar-link">导入和导出</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/preference.html" class="sidebar-link">偏好设置</a>
	                </li>
	            
	                
	                <li>
	                    <a href="/docs/guide/editor/plugin.html" class="sidebar-link">插件</a>
	                </li>
	            
	
	            
	                
	                
	                <li><h3>SDK</h3></li>
	                
	                <li>
	                    <a href="/docs/guide/sdk/laya.html" class="sidebar-link current">LayaAir</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/sdk/egret.html" class="sidebar-link">Egret</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/sdk/cocos2dx.html" class="sidebar-link">Cocos2dx</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/sdk/creator.html" class="sidebar-link">Cocos Creator</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/sdk/cryengine.html" class="sidebar-link">Cry Engine</a>
	                </li>
	            

	            
	                
	                
	                <li><h3>SDK - Unity</h3></li>
	                
	                <li>
	                    <a href="/docs/guide/unity/index.html" class="sidebar-link">显示UI面板</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/transform.html" class="sidebar-link">坐标系统</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/atlas.html" class="sidebar-link">纹理集的处理</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/font.html" class="sidebar-link">字体的处理</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/input.html" class="sidebar-link">输入处理</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/event.html" class="sidebar-link">事件机制</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/insert3d.html" class="sidebar-link">插入模型/粒子/Spine/Canvas</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/uipainter.html" class="sidebar-link">曲面UI</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/drawcall.html" class="sidebar-link">DrawCall优化</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/lua.html" class="sidebar-link">在Lua中使用</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/special.html" class="sidebar-link">特色功能</a>
	                </li>
	            
	                
	                
	                <li>
	                    <a href="/docs/guide/unity/faq.html" class="sidebar-link">常见问题</a>
	                </li>
	            

            
        </ul>
    </div>
</div>


<div class="content guide_sdk with-sidebar ">
    
      <h1>LayaAir</h1>
    
    <h2 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h2><h3 id="使用npm下载安装"><a href="#使用npm下载安装" class="headerlink" title="使用npm下载安装"></a>使用npm下载安装</h3><p><strong>注：目前只支持laya2.2及以上的版本</strong><br>在你的laya工程根目录下执行以下命令：<br><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta">$</span> npm install --save fairygui-layabox</span><br></pre></td></tr></table></figure></p>
<p>安装完成后会自动在你的laya工程的对应目录下生成相应文件：<br><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line">└── your-laya-project</span><br><span class="line">    ├─.laya</span><br><span class="line">    ├─bin</span><br><span class="line">    │   │  index.html</span><br><span class="line">    │   │  ... </span><br><span class="line">    │   ├─libs</span><br><span class="line">    │   │  │  laya.core.js</span><br><span class="line">    │   │  │  laya.html.js</span><br><span class="line">    │   │  │  ...</span><br><span class="line">    │   │  └─fairygui</span><br><span class="line">    │   │          fairygui.js</span><br><span class="line">    │   │          rawinflate.min.js</span><br><span class="line">    │   ...</span><br><span class="line">    └─libs</span><br><span class="line">        │  fairygui.d.ts</span><br><span class="line">        │  LayaAir.d.ts</span><br><span class="line">        │  ...</span><br><span class="line">    ...</span><br></pre></td></tr></table></figure></p>
<p>会在bin/index.js中自动引入相应文件：<br><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 设置LayaNative屏幕方向，可设置以下值</span></span><br><span class="line"><span class="comment"> * landscape           横屏</span></span><br><span class="line"><span class="comment"> * portrait            竖屏</span></span><br><span class="line"><span class="comment"> * sensor_landscape    横屏(双方向)</span></span><br><span class="line"><span class="comment"> * sensor_portrait     竖屏(双方向)</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="built_in">window</span>.screenOrientation = <span class="string">"sensor_landscape"</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//-----libs-begin-----</span></span><br><span class="line">loadLib(<span class="string">"libs/laya.core.js"</span>)</span><br><span class="line">loadLib(<span class="string">"libs/laya.ui.js"</span>)</span><br><span class="line">loadLib(<span class="string">"libs/laya.physics.js"</span>)</span><br><span class="line">loadLib(<span class="string">"libs/laya.html.js"</span>)</span><br><span class="line"><span class="comment">//-----libs-end-------</span></span><br><span class="line"><span class="comment">// loadLib("libs/fairygui/rawinflate.min.js");// 根据需要选择引入</span></span><br><span class="line">loadLib(<span class="string">"libs/fairygui/fairygui.js"</span>);</span><br><span class="line">loadLib(<span class="string">"js/bundle.js"</span>);</span><br></pre></td></tr></table></figure></p>
<p>更新版本：<br><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta">$</span> npm update fairygui-layabox</span><br></pre></td></tr></table></figure></p>
<p><strong>注：如果你未改变laya工程对应的目录结构，自动生成才能生效</strong></p>
<h3 id="手动下载安装"><a href="#手动下载安装" class="headerlink" title="手动下载安装"></a>手动下载安装</h3><ol>
<li>点击<a href="https://github.com/fairygui/FairyGUI-layabox" target="_blank" rel="noopener">跳转</a>，使用git clone仓库或者切换到对应laya版本的分支下载并解压。<br><img src="../../images/20200628211906.jpg" alt="切换分支"></li>
</ol>
<p>解压后1.x或2.0-2.1版本的目录结构为：<br><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line">└── FairyGUI-layabox</span><br><span class="line">    ├─bin</span><br><span class="line">    │      fairygui.d.ts</span><br><span class="line">    │      fairygui.js</span><br><span class="line">    │      fairygui.min.js</span><br><span class="line">    │</span><br><span class="line">    ├─libs</span><br><span class="line">    │  └─rawinflate</span><br><span class="line">    │            rawinflate.d.ts</span><br><span class="line">    │            rawinflate.min.js</span><br><span class="line">    │</span><br><span class="line">    └─source</span><br><span class="line">    ...</span><br></pre></td></tr></table></figure></p>
<p>解压后master(&gt;=2.2.0)版本的目录结构为：<br><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line">└── FairyGUI-layabox</span><br><span class="line">    ├─demo</span><br><span class="line">    └─source</span><br><span class="line">        │  gulpfile.js</span><br><span class="line">        │  package.json</span><br><span class="line">        │  ...</span><br><span class="line">        ├─bin</span><br><span class="line">        │      fairygui.d.ts</span><br><span class="line">        │      fairygui.js</span><br><span class="line">        │      rawinflate.min.js</span><br><span class="line">        │      </span><br><span class="line">        ├─lib</span><br><span class="line">        │      LayaAir.d.ts</span><br><span class="line">        │      rawinflate.d.ts</span><br><span class="line">        ├─src</span><br><span class="line">    ...</span><br></pre></td></tr></table></figure></p>
<ol start="2">
<li><p>将fairygui.js以及依赖的rawinflate.min.js拷贝到你的laya工程根目录下的bin/libs目录（如果你在编辑器<code>发布设置-高级设置</code>面板不勾选<code>压缩描述文件</code>，那么rawinflate.min.js是不需要的）。</p>
<figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line">└── your-laya-project</span><br><span class="line">    ├─.laya</span><br><span class="line">    └─bin</span><br><span class="line">        │  index.html</span><br><span class="line">        │  ... </span><br><span class="line">        ├─libs</span><br><span class="line">        │  │  laya.core.js</span><br><span class="line">        │  │  laya.html.js</span><br><span class="line">        │  │  ...</span><br><span class="line">        │  └─fairygui</span><br><span class="line">        │         fairygui.js</span><br><span class="line">        │         rawinflate.min.js</span><br><span class="line">        ├─res</span><br><span class="line">    ...</span><br></pre></td></tr></table></figure>
</li>
<li><p>将fairygui.d.ts文件拷贝到你的laya工程根目录下的libs目录。</p>
<figure class="highlight shell"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line">└── your-laya-project</span><br><span class="line">    ├─.laya</span><br><span class="line">    ├─bin</span><br><span class="line">    └─libs</span><br><span class="line">    	│  fairygui.d.ts</span><br><span class="line">    	│  LayaAir.d.ts</span><br><span class="line">        │  ... </span><br><span class="line">    ...</span><br></pre></td></tr></table></figure>
</li>
</ol>
<h2 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h2><ol>
<li><p>在你的laya工程里添加上述两个库的引用，注意放置的位置。</p>
<p>在1.x版本在bin/index.html中添加：</p>
<figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!--核心包，封装了显示对象渲染，事件，时间管理，时间轴动画，缓动，消息交互,socket，本地存储，鼠标触摸，声音，加载，颜色滤镜，位图字体等--&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"libs/laya.core.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!--动画库--&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"libs/laya.ani.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!--封装了html动态排版功能--&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"libs/laya.html.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!--提供了制作UI的各种组件实现--&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"libs/laya.ui.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!--如果勾选了不压缩，这个库不需要--&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"libs/fairygui/rawinflate.min.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!--只依赖laya.core,laya.html两个模块--&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"libs/fairygui/fairygui.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">	...</span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p>在2.x版本在bin/index.js中添加：</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 设置LayaNative屏幕方向，可设置以下值</span></span><br><span class="line"><span class="comment"> * landscape           横屏</span></span><br><span class="line"><span class="comment"> * portrait            竖屏</span></span><br><span class="line"><span class="comment"> * sensor_landscape    横屏(双方向)</span></span><br><span class="line"><span class="comment"> * sensor_portrait     竖屏(双方向)</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="built_in">window</span>.screenOrientation = <span class="string">"sensor_landscape"</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//-----libs-begin-----</span></span><br><span class="line">loadLib(<span class="string">"libs/laya.core.js"</span>)</span><br><span class="line">loadLib(<span class="string">"libs/laya.ui.js"</span>)</span><br><span class="line">loadLib(<span class="string">"libs/laya.physics.js"</span>)</span><br><span class="line">loadLib(<span class="string">"libs/laya.html.js"</span>)</span><br><span class="line"><span class="comment">//-----libs-end-------</span></span><br><span class="line"><span class="comment">// 尽量不要放在上面注释中间，因为会被ide'项目设置-类库设置'所覆盖</span></span><br><span class="line">loadLib(<span class="string">"libs/fairygui/rawinflate.min.js"</span>);<span class="comment">// 如果勾选了不压缩，这个库不需要</span></span><br><span class="line">loadLib(<span class="string">"libs/fairygui/fairygui.js"</span>);<span class="comment">// 只依赖laya.core,laya.html两个模块</span></span><br><span class="line">loadLib(<span class="string">"js/bundle.js"</span>);</span><br></pre></td></tr></table></figure>
</li>
</ol>
<p>​    <strong>注：FairyGUI只依赖laya.core， laya.html两个模块，不需要laya.ui。</strong></p>
<ol start="2">
<li><p>使用FairyGUI编辑器完成UI编辑。发布目录请选择Laya工程的bin/res目录（当然其他目录也是可以的）。发布后得到如下两个（或以上）文件。</p>
<p><img src="../../images/20170809160159.png" alt></p>
</li>
<li><p>在程序启动时（或者在需要用到这些UI的适当地方）加载这两个文件，并完成初始化。</p>
</li>
</ol>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line">onLoaded(): <span class="keyword">void</span> &#123;</span><br><span class="line">    Laya.stage.addChild(fgui.GRoot.inst.displayObject);</span><br><span class="line">    </span><br><span class="line">    fgui.UIPackage.addPackage(<span class="string">"res/Basic"</span>);</span><br><span class="line">    fgui.UIConfig.defaultFont = <span class="string">"宋体"</span>;</span><br><span class="line">    fgui.UIConfig.verticalScrollBar = <span class="string">"ui://Basic/ScrollBar_VT"</span>;</span><br><span class="line">    fgui.UIConfig.horizontalScrollBar = <span class="string">"ui://Basic/ScrollBar_HZ"</span>;</span><br><span class="line">    fgui.UIConfig.popupMenu = <span class="string">"ui://Basic/PopupMenu"</span>;</span><br><span class="line">    fgui.UIConfig.buttonSound = <span class="string">"ui://Basic/click"</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="小游戏开发必读"><a href="#小游戏开发必读" class="headerlink" title="小游戏开发必读"></a>小游戏开发必读</h2><ol>
<li>因为rawinflate这个库在小游戏平台有问题，所以直接不使用它。请使用最新编辑器，在发布对话框，全局设置里不勾选“压缩描述文件”就可以了。rawinflate这个库就不会再引用到（也不需要打包了）。</li>
<li><p>小游戏不支持fui扩展名，所以在发布界面要把扩展名修改成小游戏支持的扩展名（自己查阅小游戏文档）。然后在代码里设置：</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line">fairygui.UIConfig.packageFileExtension = <span class="string">"你定义的扩展名"</span>;</span><br></pre></td></tr></table></figure>
</li>
<li><p>在发布对话框，全局设置里勾选“使用二进制格式”。</p>
</li>
<li>AddPackage有两种方式，一种是传统的传入文件名方式，另一种是直接传入fui整个文件的内容，也就是说不管你内容是从哪里来的。两种方式可以按需选择。</li>
<li>如果遇到加载失败，请检查laya的加载流程。因为FairyGUI不负责加载，你需要确保资源已经顺利加载了再AddPackage。</li>
</ol>

    
    <div class="footer">
      发现错误或想贡献文档?
      <a href="https://github.com/fairygui/fairygui.github.io/tree/master/src/guide/sdk/laya.md" target="_blank">
        在 Github 上编辑此文档!
      </a>
    </div>
</div>

                
            </div>
            <script src="/docs/js/smooth-scroll.min.js"></script>
        

        <!-- main custom script for sidebars, version selects etc. -->        
        <script src="/docs/js/css.escape.js"></script>
        <script src="/docs/js/common.js"></script>
    </body>
</html>
